package com.qianli.cashmama.trade.openApi.utils.contact;

import com.fenqiguanjia.dto.device.DeviceCall;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author daixianjun
 *         设备联系人信息
 *         包括： 通讯录，通话记录，短信记录
 */
public class DeviceData implements Serializable {
    private static final long serialVersionUID = 1924090756264506358L;
    private String realName;//真实姓名

    private String mobile;//电话

    /**
     * 通讯录
     */
    private List<DeviceContact> contacts = new ArrayList<>();
    /**
     * 通话记录
     */
    private List<DeviceCall> calls = new ArrayList<>();

    /**
     * 短信
     */
    private List<DeviceSms> smsList = new ArrayList<>();

    /**
     * 通讯录记录数
     */
    private Integer totalNum = 0;
    private Integer relativeNum = 0;//亲戚数
    /**
     * 通讯录异常数
     */
    private Integer riskNum = 0;

    /**
     * 通讯录是否含有申请人本人的号码吗
     */
    private Boolean contactHitApplyMobile = false;
    private String contactApplyMobileName;

    /**
     * 通话记录是否含有申请人本人的号码
     */
    private Boolean callHitApplyMobile = false;
    private String callApplyMobileName;

    public Boolean getContactHitApplyMobile() {
        return contactHitApplyMobile;
    }

    public DeviceData setContactHitApplyMobile(Boolean contactHitApplyMobile) {
        this.contactHitApplyMobile = contactHitApplyMobile;
        return this;
    }

    public Boolean getCallHitApplyMobile() {
        return callHitApplyMobile;
    }

    public DeviceData setCallHitApplyMobile(Boolean callHitApplyMobile) {
        this.callHitApplyMobile = callHitApplyMobile;
        return this;
    }

    public String getContactApplyMobileName() {
        return contactApplyMobileName;
    }

    public DeviceData setContactApplyMobileName(String contactApplyMobileName) {
        if (StringUtils.isNotEmpty(this.contactApplyMobileName)) {
            this.contactApplyMobileName = this.contactApplyMobileName + "；" + contactApplyMobileName;
        } else {
            this.contactApplyMobileName = contactApplyMobileName;
        }
        return this;
    }

    public String getCallApplyMobileName() {
        return callApplyMobileName;
    }

    public DeviceData setCallApplyMobileName(String callApplyMobileName) {
        if (StringUtils.isNotEmpty(this.callApplyMobileName)) {
            this.callApplyMobileName = this.callApplyMobileName + "；" + callApplyMobileName;
        } else {
            this.callApplyMobileName = callApplyMobileName;
        }
        return this;
    }

    public List<DeviceContact> getContacts() {
        return contacts;
    }

    public void setContacts(List<DeviceContact> contacts) {
        this.contacts = contacts;
    }

    public List<DeviceCall> getCalls() {
        return calls;
    }

    public void setCalls(List<DeviceCall> calls) {
        this.calls = calls;
    }

    public void addContact(DeviceContact contact) {
        if (this.contacts == null) {
            this.contacts = new ArrayList<DeviceContact>();
        }
        this.contacts.add(contact);
    }

    public void addCall(DeviceCall call) {
        if (this.calls == null) {
            this.calls = new ArrayList<DeviceCall>();
        }
        this.calls.add(call);
    }


    public Integer getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    public Integer getRelativeNum() {
        return relativeNum;
    }

    public void setRelativeNum(Integer relativeNum) {
        this.relativeNum = relativeNum;
    }

    public Integer getRiskNum() {
        return riskNum;
    }

    public void setRiskNum(Integer riskNum) {
        this.riskNum = riskNum;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public List<DeviceSms> getSmsList() {
        return smsList;
    }

    public DeviceData setSmsList(List<DeviceSms> smsList) {
        this.smsList = smsList;
        return this;
    }
}
